// BookQueryDlg.cpp : implementation file
//

#include "stdafx.h"
#include "library.h"
#include "BookQueryDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBookQueryDlg dialog


CBookQueryDlg::CBookQueryDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBookQueryDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBookQueryDlg)
	m_strID = _T("");
	//}}AFX_DATA_INIT
	m_bState = FALSE;
}


void CBookQueryDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBookQueryDlg)
	DDX_Text(pDX, IDC_BOOK_QUERY_NAME_EDIT, m_strID);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBookQueryDlg, CDialog)
	//{{AFX_MSG_MAP(CBookQueryDlg)
	ON_BN_CLICKED(IDC_BOOK_QUERY_CANCEL_BUTTON, OnBookQueryCancelButton)
	ON_BN_CLICKED(IDC_BOOK_QUERY_OK_BUTTON, OnBookQueryOkButton)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBookQueryDlg message handlers

void CBookQueryDlg::OnBookQueryCancelButton() 
{
	// TODO: Add your control notification handler code here
	m_bState = FALSE;
	CDialog::OnCancel();
}

void CBookQueryDlg::OnBookQueryOkButton() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	m_strID.TrimLeft();
	m_strID.TrimRight();
	m_bState = TRUE;

	CDialog::OnOK();
}

int CBookQueryDlg::DoModal() 
{
	// TODO: Add your specialized code here and/or call the base class
	CDialog::DoModal();
	return m_bState;
}
